package ru.st.selenium;

import static org.junit.Assert.assertTrue;

import java.util.concurrent.TimeUnit;

import ru.st.selenium.pages.TestBase;

public class AddNewUser extends TestBase {

  @org.testng.annotations.Test
  public void addNewUserOK() {
    String username = "user" + System.currentTimeMillis();
    ru.st.selenium.model.User user = new ru.st.selenium.model.User()
      .setLogin(username)
      .setPassword("password")
      .setEmail(username + "@test.com");
    
    
    app.getUserHelper().loginAs(ADMIN);
    app.getUserHelper().createUser(user);
    app.getUserHelper().logout();
    app.getUserHelper().loginAs(user);
    assertTrue(app.getUserHelper().isLoggedInAs(user));
  }

}
